import re
def clean_path(path:str):
    if path.endswith('.'):
        path=path.rstrip('.')
    path=re.sub('[\\/:*?"<>|\r\n]+', '_', path)
    return path

if __name__ == '__main__':
    print(clean_path('1...'))